﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
// download by http://www.codefans.net
namespace WindowsFormsApplication1
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void textBox1_KeyPress(object sender, KeyPressEventArgs e)
        {
            //if (e.KeyChar == 13)
            //{
            //    this.textBox1.Focus();
            //}
            //else if (e.KeyChar < '0' || e.KeyChar > '9')
            //{
            //    e.Handled = true;
            //}
            //else if (e.KeyChar == 8)
            //{
            //    e.Handled = false;
            //}
            if (e.KeyChar == 10)
            {
                this.textBox1.Focus();
            }
            else if (e.KeyChar < '0' || e.KeyChar > '9')
            {
                e.Handled = true;
            }
            else if (e.KeyChar == 8)
            {
                e.Handled = false;
            }
        }

        private void Form1_Load(object sender, EventArgs e)
        {

        }

        private void textBox1_TextChanged(object sender, EventArgs e)
        {

        }


    }
}
